<?php include_once 'common/header.php'; ?>
<script src="<?php echo CON_STATIC_URL; ?>js/tab.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(function () {
        $(".af4").slide({
            affect: 4,
            time: 3000,
            speed: 400
        });
    })
</script>



<div class="wrap af4">

    <ul class="slider" id="slider"  style="display: block;">
                    <li data-opacity="0.2" style="background:url(/static/data/upfiles/scrollpic/1.jpg) no-repeat center center #F2F2F2;">
                <a href="#"></a>
            </li>
                    <li data-opacity="0.2" style="background:url(/static/data/upfiles/scrollpic/2.jpg) no-repeat center center #F2F2F2;">
                <a href="#"></a>
            </li>
                    <li data-opacity="0.2" style="background:url(/static/data/upfiles/scrollpic/3.jpg) no-repeat center center #F2F2F2;">
                <a href="#"></a>
            </li>
            </li>
                    <li data-opacity="0.2" style="background:url(/static/data/upfiles/scrollpic/4.jpg) no-repeat center center #F2F2F2;">
                <a href="#"></a>
            </li>
            </li>
                    <li data-opacity="0.2" style="background:url(/static/data/upfiles/scrollpic/5.jpg) no-repeat center center #F2F2F2;">
                <a href="#"></a>
            </li>
            </ul>
    <ul class="slider" id="slider"  style="display: block;">
        <?php foreach($scrollpic_list as $list):?>
            <li data-opacity="0.2" style="background:url(<?php echo  SCROLLPIC_IMG.$list['pic']; ?>) no-repeat center center #F2F2F2;">
                <a href="<?php echo $list['url'];?>"></a>
            </li>
        <?php endforeach;?>
    </ul>
</div>
<!--Index banner-->
<div class="w1000" style="position:relative;">
    <div class="floatRight">
        <div class="index_login">

            <?php if(!empty($userInfo)):?>
                <h2>欢迎来到<?php echo CON_PLATFORMNAME;?></h2>
                <p class="mrt20">您当前的账户可用余额为:<?php echo $user_account['use_money'];?>元</p>
                <p class="login-button mrt30"><a href="/user/center.html">账户管理</a></p>
            <?php else:?>
                <p class="txt-c f20 txt-b">年化收益率</p>
                <p class="login-red txt-c f34" style="font-weight:bold;">18%-24%</span></p>
                <p class="txt-c f20 txt-b">50倍活期存款收益</p>
                <p class="txt-c">
               		 <a href="/reg.html" class="index-login-reg" >免费注册</a>
               		 <a href="/login.html" class="index-login-login">立即登录</a>
                </p>
            <?php endif;?>
        </div>
    </div>
 </div>
    <!--index Login-->

    <div class="data">
        <div class="w1000" style="border: 1px solid #eeeeee ;">
            <div class="data-box">
                <p>注册人数:<span><?php echo $reg['total'];?></span>人</p>
            </div>
           <div class="data-box">
                <p>今日交易:<span>
                <?php
                	function jgToYWY($jg) {
                		$jg = $jg;
                		$jr = strlen($jg);
                		if($jr<5) { //4位 千位
                			echo $jg.'</span>元';
                		}else if($jr>=5 && $jr<9) { // 5-8位
                			$new_jg = strrev($jg);
                			$w = strrev(substr($new_jg,4));
                			$y = strrev(substr($new_jg,0,4));
            				echo $w.'</span>万'.($y>0? "<span>$y</span>元" :'');
                		}else{ //9位以上
                			$new_jg = strrev($jg);
                			$yi = strrev(substr($new_jg,8));
                			$w = strrev(substr($new_jg,4,4));
                			$y = strrev(substr($new_jg,0,4));
                			echo $yi.'</span>亿'.($w>0? "<span>$w</span>万" : '').($y>0? "<span>$y</span>元":'');
                		}
                	}
                	jgToYWY($index_tongji['daytrade']);
                ?></p>
            </div>
            <div class="data-box">
                <p>累计投资:<span><?php jgToYWY($index_tongji['account']);?></p>
            </div>
        </div>
    </div>
    <!--Index data-->
    	<div class="clear"></div>
	
	<div class="mfjr_des w1000" >
	
	<div class="mfjr_des_box1">
	 <p class="mfjr_des_box_title">0风险的网上理财</p>
	 <p><span>7道</span>审核、<span>FICO</span>评分、</p>
	 <p>机构<span>全额担保</span></p>
	</div>
	<div class="mfjr_des_box2">
	  <p class="mfjr_des_box_title">高收益也可以低门槛</p>
	  <p><span style="font-size:24px;">30</span>倍银行存款利息，</p>
      <p><span style="font-size:24px;">50</span>元起步，<span style="font-size:24px;">0</span>手续费</p>
	</div>
	<div class="mfjr_des_box3">
	  <p class="mfjr_des_box_title">简单4步快捷理财</p>
	  <p>快速充值<span>提现</span>，</p>
	  <p>更<span>高效</span>，易<span>操作</span>，更<span>便捷</span></p>
	</div>
	<div class="mfjr_des_box4">
	  <p class="mfjr_des_box_title">随时随地赎回投资</p>
	  <p>突然急用钱想收回投资？</p>
      <p><span style="font-size:24px;">2</span>步搞定，最快<span>当天到账</span></p>
	</div>
</div>

    <!--Index strength-->
    <!--Index main-content -->
    <div style="background-color:#eeeeee;padding-bottom:20px;">
    <div class="index-main">
        <!--新手体验标-->
        <div class="w1000" style="border: 1px solid #eeeeee ;">
            <div class="content-title borderYellow"><h2>新手体验标</h2></div>
            <div class="content-body">
                <div class="content-desc">
                    <p >&nbsp;<span style="font-size:16px;">新手专享</span>&nbsp;&nbsp;
                    <span style="color:#777777;font-size:13px;">限未成功投资过的新用户，仅享有一次机会，每人限投10,000元</span></p>
                </div>
                <?php foreach($borrow_list_mjb as $list):?>
                    <div class="content-item">
                        <div class="item-body">
                            <div class="item-desc">
                                <p class="mrt20 " style="width: 330px;">【新手专享】<a title="<?php echo $list['title'];?>" class="hover_red" href="/borrow/obj/<?php echo $list['id'];?>.html"><?php echo mb_substr($list['title'],0,12);?></a></p>
                                <p class="mrt10"  style="width: 250px;color:#777777;">年化收益&nbsp;<span class="red" style="font-size: 22px;" ><?php echo $list['apr'];?>%</span></p>
                                <p class="mrt10 "  style="color:#777777;">项目期限&nbsp;<span class="grey" style="font-size: 22px;"><?php echo $list['is_day'] ? "{$list['time_limit']}</span>天":"{$list['time_limit']}</span>个月";?></p>
                            </div>
                            <div style="margin-top:60px;">
                                <p class="mrt20 mrg10">
                                <span style="font-size: 16px;">抢标啦</span>!<span style="color:#777777;font-size:13px;">小贷短期融资标，年化收益再加<span class="red">2%~5%</span>,每人限投20,000元</span></p>
                            </div>
                        </div>
                        <div class="item-footer">
                            <p class="view"><a href="/borrow/obj/<?php echo $list['id'];?>.html" id="view">查看详情</a></p>
                            <p class="buyButton-index" style="background-color: <?php if($list['fstatus'] == 3) echo '#c3c3c3';?>"><a href="/borrow/obj/<?php echo $list['id'];?>.html" id="buy" style="width: 140px;display: inline-block;"><?php echo borrowStatus($list);?></a></p>
                        </div>
                    </div>
                <?php endforeach;?>

            </div>
        </div>
        <!--我要投资-->
        <div class="w1000" style="border: 1px solid #eeeeee ;">
            <div class="content-body">
                <div class="content-title borderBlue"><h2>我要投资</h2><span><a class="more" href="/borrow/blist.html">更多></a></span></div>
                <div class="main-content-left">
                    <div class="investment">
                        <?php foreach($borrow_list as $list):?>
                        <div class="investment-box">
                            <div class="investment-item-title">
                                <span class=" title f18"><a href="/borrow/obj/<?php echo $list['id'];?>"><?php echo $list['title'];?></a></span>
                                <span class="icon-investment icon-db"><?php echo $borrow_type_img[$list['ftype']];?></span>
                                <span class="fright f12">发标时间:<?php echo date("Y年m月d日 H:i",$list['verify_time']);?></span>
                            </div>

                            <div class="investment-item-body w650">
                                <div class="investment-item-left w140">
                                    <img class="borrow_img" src="<?php echo "/".BORROW_IMG."/".$list['thumbnail'];?>">
                                </div>
                                <div class="investment-item-mid w325">
                                    <div class="item-big w130">
                                        <h2>￥<?php echo $list['account'];?></h2>
                                        <p style="text-align:center;">借款金额</p>
                                    </div>

                                    <div class="item-small w80">
                                        <h2><?php echo $list['apr'];?>%</h2>
                                        <p style="text-align:center;">年化利率</p>
                                    </div>

                                    <div class="item-small w80">
                                        <h2><?php echo $list['is_day'] ? "{$list['time_limit']}天" : "{$list['time_limit']}个月"?></h2>
                                        <p>借款期限</p>
                                    </div>
                                </div>
                                <div class="investment-item-right w150">
                                    <div>
                                        <div class="progress-background">
                                            <div class="progress-bar" style="width:<?php echo ($list['account_yes']/$list['account'])*100;?>%"></div>
                                        </div>
                                        <span class="progress-num">&nbsp;<b><?php echo ($list['account_yes']/$list['account'])*100;?></b>%</span>
                                    </div>
                                    <div>
                                        <p class="mrt15 f12">已投<?php echo $list['tender_times'];?>笔,共计<?php echo  number_format($list['account_yes']/10000,2);?>万</p>
                                        <p class="buyButton-index" style="background-color: <?php if($list['fstatus'] == 3) echo '#c3c3c3';?>;">
                                            <a class="buttonText" href="/borrow/obj/<?php echo $list['id'];?>" style="width: 140px;display: inline-block;"><?php echo borrowStatus2($list);?></a>
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php endforeach;?>
                    </div>
                </div>

                <!--main-content-right-->
                <div class="main-content-right mrt10">
                    <div class="notice">
                        <h2>平台公告<a href="/site/announcement/gonggao.html"><span class="notice-more">more></span></a></h2>
                        <ul>
                            <?php foreach($gonggao_list as $list):?>
                                <li><a href="/site/view/<?php echo $list['id']; ?>.html"><?php echo $list['title'];?></a></li>
                            <?php endforeach;?>
                        </ul>
                    </div>

                    <div class="news mrt10">
                        <h2>公司咨询<a href="/site/announcement/company.html"><span class="notice-more">more></span></a></h2>
                        <ul>
                            <?php foreach($company_list as $list):?>
                                <li><a href="/site/view/<?php echo $list['id']; ?>.html"><?php echo $list['title'];?></a></li>
                            <?php endforeach;?>
                        </ul>
                    </div>

                    



                  
                    <div class="comparison mrt10">
                        <h2>收益对比<span class="f12 clo-gray r" >数据来源：某某理财网（按周统计）</span></h2>
                        <img src="<?php echo CON_STATIC_URL;?>images/comparison-img.jpg"/>
                    </div>
                    
                    
                    
                                        <div class="rank-list">
                        <div class="tab-list">
                            <ul id="tab-list-li">
                                <li class="title_hover" style="width:98px;">


                                <a href="javascript:void(0);" onclick="changeTab(this)" >总排行</a></li>

                                <li style="width:98px;">

                                <a href="javascript:void(0);" onclick="changeTab(this)" >月排行</a></li>

                                <li style="width:99px;">

                                <a href="javascript:void(0);" onclick="changeTab(this)" >周排行</a></li>

                            </ul>
                        </div>
                        
                        <div class="linksQWap">
                        <div class="tab-con">
                            <ul >
                                    <li class="col-grey">
                                        <span style="width:85px;">排名</span>
                                        <span style="width:100px;text-align:left;">用户名</span>
                                        <span>投资金额</span>
                                    </li>
                                    <?php foreach($total_rank as $k=>$list) {?>
                                    <li>
                                        <span class="rank-num"><?php echo $k+1;?></span>
<!--                                        <span class="col-darkblue" style="width:100px;text-align:left;">--><?php //if($list['sex'] == 1) {echo mb_substr($list['realname'],0,1).'先生';} elseif($list['sex'] == 2) {echo mb_substr($list['realname'],0,1).'女士';} elseif($list['sex'] == 0){echo '匿名';}?><!--</span>-->
                                        <span class="col-darkblue" style="width:100px;text-align:left;"><?php echo substr($list['username'],0,2).'****';?></span>
                                        <span class="col-red" style="text-align:left;">¥<?php echo $list['money'];?></span>

                                    </li>
                                    <?php }?>
                                </ul>
                        </div>
                           <div class="tab-con" style="display: none;">   
                                <ul>
                                    <li class="col-grey">
                                        <span style="width:85px;">排名</span>
                                        <span style="width:100px;text-align:left;">用户名</span>
                                        <span>投资金额</span>
                                    </li>
                                    <?php foreach($month_rank as $k=>$list) {?>
                                        <li>

                                            <span class="rank-num" ><?php echo $k+1;?></span>
<!--                                            <span class="col-darkblue" style="width:100px;text-align:left;">--><?php //if($list['sex'] == 1) {echo mb_substr($list['realname'],0,1).'先生';} elseif($list['sex'] == 2) {echo mb_substr($list['realname'],0,1).'女士'; } elseif($list['sex'] == 0){echo '匿名';}?><!--</span>-->
                                            <span class="col-darkblue" style="width:100px;text-align:left;"><?php echo substr($list['username'],0,2).'****';?></span>
                                            <span class="col-red" style="text-align:left;">¥<?php echo $list['money'];?></span>

                                        </li>
                                    <?php }?>
                                </ul>
                            </div>

							<div class="tab-con" style="display: none;">
                                <ul>
                                    <li class="col-grey">
                                        <span style="width:85px;">排名</span>
                                        <span style="width:100px;text-align:left;">用户名</span>
                                        <span>投资金额</span>
                                    </li>
                                    <?php foreach($week_rank as $k=>$list) {?>
                                        <li>

                                            <span class="rank-num"><?php echo $k+1;?></span>
<!--                                            <span class="col-darkblue" style="width:100px;text-align:left;">--><?php //if($list['sex'] == 1) {echo mb_substr($list['realname'],0,1).'先生';} elseif($list['sex'] == 2) {echo mb_substr($list['realname'],0,1).'女士';} elseif($list['sex'] == 0){echo '匿名';}?><!--</span>-->
                                            <span class="col-darkblue" style="width:100px;text-align:left;"><?php echo substr($list['username'],0,2).'****';?></span>
                                            <span class="col-red" style="text-align:left;">¥<?php echo $list['money'];?></span>

                                        </li>
                                    <?php }?>
                                </ul>
                            </div>
                        </div> 
                           
                        </div> 

<script>
$(function () {
    $('#tab-list-li li').click(function () {
    var liindex = $('#tab-list-li li').index(this);
            $(this).addClass('title_hover').siblings().removeClass('title_hover');
            $('.linksQWap div.tab-con').eq(liindex).fadeIn(150).siblings('div.tab-con').hide();
    });
    });
</script>


                    
                </div>

            </div>
        </div>
        <!--转让专区-->
        <div class="w1000" style="margin-bottom: 20px;border: 1px solid #eeeeee ;">
            <div class="content-title borderRed"><h2>债权转让专区</h2><span><a class="more" href="/borrow/transfer_list.html">更多></a></span></div>
            <div class="investment-tender">
                <div class="tender-items">
<!-- 
                    <a><?php foreach($creditorList['list'] as $list):?> -->
                        <div class="tender-item">
                            <ul>
                                <li class="tender-title"><a href="/borrow/creditor/<?php echo $list['id'];?>"><?php echo $list['title'];?></a></li>
                                <li>年化收益&nbsp;<span class="strongRed"><?php echo $list['apr'];?>%</span></li>
                                <li>剩余期限&nbsp;<span class="strongGrey"><?php echo $list['valid_time'];?></span>天</li>
                                <li>转让价格&nbsp;<span class="strongGrey"><?php echo $list['discount_account'];?></span>元</li>

                                <li class="buyButton-index-zr"><a href="/borrow/creditor/<?php echo $list['id'];?>" class="buttonText" style="display: inline-block;width: 100%;">立即投资</a></li>

                                

                            </ul>
                        </div>
                   <!--  <?php endforeach;?></a>-->

                </div>
                <div class="advertisement " style="float: right;">
                    <a href="shop.html"><img src="../../static/images/ad.png"></a>
                </div>
            </div>
        </div>
<div class="clear"></div>
        <div class="index-link w1000">
            <div class="link-title">
                <ul id="tab-list">
                    <li class="title-hover">
                        <a onclick="changeTab(this)" href="javascript:void(0);" class="corporation">合作商家</a>
                    </li>
                </ul>
            </div>
            <div class="linkwrap">
                <div class="linktab">
                    <ul>
                        <?php foreach($cases_list as $list):?>
                            <li style=""><a target="_blank" href="<?php echo $list['url'];?>"><img height="35" src="<?php echo CON_STATIC_URL;?>data/upfiles/links/<?php echo $list['logoimg'];?>"></a></li>
                        <?php endforeach;?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    </div>
<script>
   $(function () {
      $('#tab-list li').click(function () {
          var liindex = $('#tab-list li').index(this);
          $(this).addClass('title-hover').siblings().removeClass('title-hover');
          $('.linkwrap div.linktab').eq(liindex).fadeIn(150).siblings('div.linktab').hide();
        });
      });
</script>
<div class="clear"></div>
<?php include "common/footer.php";?>